package dyyx.util;

import java.time.LocalDateTime;

import dyyx.intf.AllInOneService;

public abstract class ServiceUtil {
	
	
	private static volatile AllInOneService allInOneService;

			
	public static AllInOneService getAllInOneService(){
		if(allInOneService!=null){
    		return allInOneService;
    	}
		return getAllInOneService_();
	}
	
    private static synchronized AllInOneService getAllInOneService_(){
    	if(allInOneService!=null){
    		return allInOneService;
    	}
    	
    	AllInOneService allInOneServiceTmp = (AllInOneService)SpringUtil.getApplicationContext().getBean("allInOneServiceClient");
		allInOneService = allInOneServiceTmp;
		
		RunStatusUtil.updateStaticInfo("allInOneServiceCreateTime", LocalDateTime.now().toString());
		
		return allInOneService;
	}
	
	

}
